package com.lvmama.pangolin.conf;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;

import com.lvmama.pangolin.kafka.SpiderProductProcesser;
@Component
@EnableConfigurationProperties(KafkaSettings.class)
public class AtuoLoading implements CommandLineRunner
{
	
	@Autowired
	private SpiderProductProcesser  spiderProductProcesser;
	@Autowired
    private KafkaSettings kafkaSetting;
	@Autowired
    private SecuritySettings settings;
	@Override
	public void run(String... args) throws Exception
	{
		//消费抓取消息数据
		boolean spiderMsg_consumer_start = kafkaSetting.getAuto_start();
		//消费抓取消息数据
		if(spiderMsg_consumer_start)
		{
			spiderProductProcesser.startConsumer();
		}
		
	}
	
}
